import 'package:json_annotation/json_annotation.dart';



@JsonSerializable()
class CommodityTop {
  CommodityTop();

  String? shopId;
  String? shopName;
  String? shopIcon;
  String? id;
  String? title;
  String? content;
  List<String>? files;
  String? time;
  int? supports;
  int? currentUserSupport;
  String? commodityId;
  factory CommodityTop.fromJson(Map<String,dynamic> json) {
    return CommodityTop()
      ..shopId = json['shopId'] as String?
      ..shopName = json['shopName'] as String?
      ..shopIcon = json['shopIcon'] as String?
      ..id = json['id'] as String?
      ..title = json['title'] as String?
      ..content = json['content'] as String?
      ..files = (json['files'] as List?)?.map((e) => e as String).toList()
      ..time = json['time'] as String?
      ..supports = json['supports'] as int?
      ..currentUserSupport = json['currentUserSupport'] as int?
      ..commodityId = json['commodityId'] as String?;
  }

  Map<String, dynamic> toJson() {
    return {
      'shopId': shopId,
      'shopName': shopName, 
      'shopIcon': shopIcon,
      'id': id,
      'title': title,
      'content': content,
      'files': files,
      'time': time,
      'supports': supports,
      'currentUserSupport': currentUserSupport,
      'commodityId': commodityId,
    };
  }
}
